<?php include './application/views/common/zhs_header.php';?>
<div class="newtitle-box">
  <div class="newtitle w">
    <span class="invlist_title">您现在的位置：<a href="index.html">首页</a>><a class="red" href="#">论坛</a></span>
  </div>
</div>

<?php include './application/views/forum/zhs_title.php';?>

<div class="login_box w">
 <?php include './application/views/forum/zhs_left.php'; ?>
 
  <div class="bbsbd_right">
    <h3 class="bbsh3"><a href="/forum/forumList/<?php echo $theme['id']?>"><?php echo $theme['name']?></a></h3>
    <ul class="bbsbdrg_ul">
       <li><h3><?php echo $forum_post['subject']?><br><span>发表时间：<?php echo date('Y-m-d H:i:s',$forum_post['add_time'])?>   点击：79116   回复：<?php echo $forum_post['recovery']?></span></h3><a class="bbsbtn_3" href="/forum/thread/<?php echo $forum_post['id']?>/?is_floor=1"></a><a class="bbsbtn_1" href="#"></a></li>
       
       <?php $idx=0; foreach($forum_list as $cv){$idx++;?>
       <li id="post_<?php echo $cv['id'];?>">
         <dl>
           <dd><a class="bbsrgimg" href="#"><img alt="<?php echo $cv['author'];?>" src="<?php if(is_file('./static/data/avatar/'.$cv['authorid'].'_avatar_big.jpg') && $cv['authorid'] > 0){?>/static/data/avatar/<?php echo $cv['authorid'];?>_avatar_small.jpg <?php }else{ echo CON_STATIC_URL."zhsjr/images/bbs_6.gif";}?>"></a>
               <span></span>
           </dd>
           <dt><?php if($cv['is_floor'] == 1){?>楼主:<?php }?><a href="#"><?php echo $cv['author'];?></a></dt>
         </dl>
         <h4 id="postContent<?php echo $cv['id'];?>"><?php echo $cv['comment'];?></h4>
       <div class="bbsrg_txt"><?php echo $idx;?>楼 <?php echo date('Y-m-d H:i:s',$cv['add_time'])?>  </div>
       </li>
      <?php }?> 
      <div class="page"><?php echo $this->pagination->create_links();?></div>
       <li>
         <div class="bbsinpbox">
           <div class="bbsbd_top">
            <textarea id="posts_comment" placeholder="说点什么吧" class="bbsinput"  name="posts_comment" ></textarea>
           </div>
           <div class="bbsbot">
          	 <input type="hidden" value="<?php echo $forum_post['id'];?>" name="comment_post_id" id="comment_post_id"/>
          	  <a href="javascript:;" class="botbtn_1"></a><a href="javascript:;" class="botbtn_2"></a> 
             <div class="botrg">
             	<input class="botin" type="text" name="ve_code" id="ve_code">
            	<a href="javascript:;"><img src="/yanzheng/index/" id="imgCode" style="cursor: pointer;" /></a>
                <a href="javascript:;" class="bota" onclick="postcomment(this)"></a>
             </div>
           </div>
         </div>
       </li>
    </ul>
  </div>
  
</div> 
<script type="text/javascript">
function postcomment() {
    var t_content = $('#posts_comment').val();
    if (t_content == "") {
        alert('请输入回复内容！');
        return;
    }

    $.ajax({
        type: "POST",
        url: "/forum/forum_comment",
        data: "content=" + t_content + "&id=" + $("#comment_post_id").val()+ "&ve_code=" + $("#ve_code").val(),
        success: function (msg) {
            if (msg == 'ok') {
                alert('发表成功');
                window.location.reload();
            } else if (msg == 2) {
                alert('请先登陆');
                window.location.href = "/login.html";
            }else {
                alert('发表失败:'+msg);
                document.getElementById("imgCode").src = "/yanzheng/index/?" + Math.random();
            }
        },
        dataType: "text"
    });
}

</script>
<?php include './application/views/common/zhs_footer.php';?>
<?php include './application/views/common/zhs_right.php';?>
